home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / ka9q / kit_src / proc02.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-03  |  4.4 KB  |  168 lines

  1. /*    (C) Copyright 1991 Dave Fritsche (wb8zxu), All Rights Reserved.
  2.  * 
  3.  *    Redistribution and use in source and binary forms are permitted for
  4.  *    non-commercial use, provided that the above copyright notice and this
  5.  *    paragraph are duplicated in all such forms.  THIS SOFTWARE IS PROVIDED
  6.  *    ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
  7.  *    WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
  8.  *    FITNESS FOR A PARTICULAR PURPOSE.
  9.  */
  10. #include <stdio.h>
  11. #include <ctype.h>
  12. #include "screen.h"
  13.  
  14. proc02()
  15. {
  16.     unsigned int m, n, k;
  17.     unsigned long ip1, ip2, ip3, ip4;
  18.  
  19. /* STRIP PASSWORD DOWN */
  20.     if (rmt_pass)
  21.     {
  22.         chktxt(ifd[rmt_pass-1]); 
  23.         strcpy(password, ifd[rmt_pass-1]);
  24.     }
  25.  
  26. /* STRIP EDITOR PATH */
  27.     chktxt(ifd[ed_path-1]);
  28.     strcpy(editor, ifd[ed_path-1]);
  29.  
  30. /* STRIP PAGER PATH */
  31.     if (netnews)
  32.     {
  33.         chktxt(ifd[pgr-1]);
  34.         strcpy(pager, ifd[pgr-1]);
  35.     }
  36.  
  37. /* STRIP TIME ZONE */
  38.     chktxt(ifd[tz-1]);
  39.     ifd[tz-1][0] = (unsigned char)toupper( (unsigned int)ifd[tz-1][0] );
  40.     ifd[tz-1][1] = (unsigned char)toupper( (unsigned int)ifd[tz-1][1] );
  41.     ifd[tz-1][2] = (unsigned char)toupper( (unsigned int)ifd[tz-1][2] );
  42.     strcpy(timezone, ifd[tz-1]);
  43.  
  44. /* CONVERT IP ADDRESS TO LONG INT */
  45.     if (gate_rqd)
  46.     {
  47.         buf[3] = NULL;
  48.         buf[0] = ifd[gate_rqd-1][1];    buf[1] = ifd[gate_rqd-1][2];    buf[2] = ifd[gate_rqd-1][3];
  49.         sscanf(buf, "%ld", &ip1);
  50.         buf[0] = ifd[gate_rqd-1][5];    buf[1] = ifd[gate_rqd-1][6];    buf[2] = ifd[gate_rqd-1][7];
  51.         sscanf(buf, "%ld", &ip2);
  52.         buf[0] = ifd[gate_rqd-1][9];    buf[1] = ifd[gate_rqd-1][10];    buf[2] = ifd[gate_rqd-1][11];
  53.         sscanf(buf, "%ld", &ip3);
  54.         buf[0] = ifd[gate_rqd-1][13];    buf[1] = ifd[gate_rqd-1][14];    buf[2] = ifd[gate_rqd-1][15];
  55.         sscanf(buf, "%ld", &ip4);
  56.         gateway = (long)( (ip1 << 24) | (ip2 << 16) | (ip3 << 8) | ip4 );
  57.     }
  58.  
  59. /* COM1 */
  60.     if (com1)
  61.     {
  62.         sscanf(ifd[com1-1], "%ld", &com1spd);
  63.         chktxt(ifd[com1]);
  64.         strcpy(com1typ, ifd[com1]);
  65.     }
  66.  
  67. /* COM2 */
  68.     if (com2)
  69.     {
  70.         sscanf(ifd[com2-1], "%ld", &com2spd);
  71.         chktxt(ifd[com2]);
  72.         strcpy(com2typ, ifd[com2]);
  73.     }
  74.  
  75. /* COM3 */
  76.     if (com3)
  77.     {
  78.         sscanf(ifd[com3-1], "%ld", &com3spd);
  79.         chktxt(ifd[com3]);
  80.         strcpy(com3typ, ifd[com3]);
  81.     }
  82.  
  83. /* COM4 */
  84.     if (com4)
  85.     {
  86.         sscanf(ifd[com4-1], "%ld", &com4spd);
  87.         chktxt(ifd[com4]);
  88.         strcpy(com4typ, ifd[com4]);
  89.     }
  90.  
  91. /* DRSI 0 */
  92.     if (drsi_0)
  93.     {
  94.         sscanf(ifd[drsi_0-1], "%ld", &drsi_0spd);
  95.         chktxt(ifd[drsi_0]);
  96.         strcpy(drsi_0typ, ifd[drsi_0]);
  97.     }
  98.  
  99. /* DRSI 1 */
  100.     if (drsi_1)
  101.     {
  102.         sscanf(ifd[drsi_1-1], "%ld", &drsi_1spd);
  103.         chktxt(ifd[drsi_1]);
  104.         strcpy(drsi_1typ, ifd[drsi_1]);
  105.     }
  106.  
  107. /* PC100 0 */
  108.     if (pc100_0)
  109.     {
  110.         sscanf(ifd[pc100_0-1], "%ld", &pc100_0spd);
  111.         chktxt(ifd[pc100_0]);
  112.         strcpy(pc100_0typ, ifd[pc100_0]);
  113.     }
  114.  
  115. /* PC100 1 */
  116.     if (pc100_1)
  117.     {
  118.         sscanf(ifd[pc100_1-1], "%ld", &pc100_1spd);
  119.         chktxt(ifd[pc100_1]);
  120.         strcpy(pc100_1typ, ifd[pc100_1]);
  121.     }
  122.  
  123. printf("    Callsign:  %s\n", callsign);
  124. printf("  IP Address:  [%ld.%ld.%ld.%ld]", ((ip >> 24) & 0xff),
  125.             ((ip >> 16) & 0xff), ((ip >> 8) & 0xff), (ip & 0xff));
  126. if (gate_rqd)
  127.   printf("     Gateway Address:  [%ld.%ld.%ld.%ld]", ((gateway >> 24) & 0xff),
  128.   ((gateway >> 16) & 0xff), ((gateway >> 8) & 0xff), (gateway & 0xff));
  129. printf("\n\n        Name:  %s\n", name);
  130. printf("      Street:  %s\n", street);
  131. printf("        City:  %s", city);
  132. printf("       State:  %s", state);
  133. printf("    Zip-code:  %s\n", zip);
  134. printf("       Phone:  %s\n\n", phone);
  135. printf("        Path:  %s", path);
  136. if (rmt_pass)
  137.   printf("     Password:  %s", password);
  138. printf("     Timezone:  %s\n\n", timezone);
  139. if (com1)
  140.   printf(" Serial port:  Com1\n");
  141. if (com2)
  142.   printf(" Serial port:  Com2\n");
  143. if (com3)
  144.   printf(" Serial port:  Com3\n");
  145. if (com4)
  146.   printf(" Serial port:  Com4\n");
  147. if (drsi_0)
  148.   printf("        DRSI:  first port\n");
  149. if (drsi_1)
  150.   printf("        DRSI:  second port\n");
  151. if (pc100_0)
  152.   printf("       PC100:  first port\n");
  153. if (pc100_1)
  154.   printf("       PC100:  second port\n");
  155. if (gate_rqd)
  156.   printf("\n               A default IP gateway is desired\n");
  157. else
  158.   printf("\n               No default IP gateway specified\n");
  159. if (nr_rqd)
  160.   printf("               Netrom is required\n");
  161. else
  162.   printf("               Netrom is not required\n");
  163. if (rmt_pass)
  164.   printf("               A remote password is required\n");
  165. else
  166.   printf("               A remote password is not required\n");
  167. }
  168.